package com.hwbsite.hwbback.entity;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;

public class HwbUser extends User {
    /**
     * 用户ID
     */
    @Getter
    private final String userId;
    /**
     * 昵称
     */
    @Getter
    private final String nickName;

    /**
     * 头像
     */
    @Getter
    private final String avatar;

    /**
     * 背景
     */
    @Getter
    private final String bgImg;

    public HwbUser(String username, String password, Collection<? extends GrantedAuthority> authorities,UserInfo userInfo) {
        super(username, password, authorities);
        this.userId = userInfo.getUserId();
        this.nickName = userInfo.getNickName();
        this.avatar =  userInfo.getAvatar();
        this.bgImg =  userInfo.getBgImg();
    }
}
